package org.wlgzs.office_exam_student.service.office;

import org.wlgzs.office_exam_student.service.office.OfficeConfig.FileType;
import org.wlgzs.office_exam_student.service.office.OfficeConfig.PaperType;

/**
*@author song(mejeesong@qq.com)
*2018年1月30日
*解析任务，每生成一个新的解析任务，便new一个此类，送给OfficeResolverService
*/
public class ResolveTask {
	
	//送给OfficeResolverService时返回一个Id,可通过此Id获得OfficeResolverService提供的方法
	private long id;
	private int index;
	//默认为0,为模拟练习
	private int examId;
	private FileType fileType;
	private PaperType paperType;
	private int userId;
	//用来标识是哪一题
	private String fileKey;
	private FinishedCall finshedCall ;
	private ResolveResult resolveResult = null;
	
	public ResolveTask(int userId,String fileKey,FileType fileType,PaperType paperType) {
		this.userId = userId;
		this.fileKey = fileKey;
		this.fileType = fileType;
		this.paperType = paperType;
	}
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public FileType getFileType() {
		return fileType;
	}
	public String getFileTypeStr() {
		if(fileType == OfficeConfig.FileType.DOCX) {
			return OfficeConfig.FILETYPE_DOCX;
		}else if(fileType == OfficeConfig.FileType.XLSX) {
			return OfficeConfig.FILETYPE_XLSX;
		}else if(fileType == OfficeConfig.FileType.PPTX) {
			return OfficeConfig.FILETYPE_PPTX;
		}else {
			return "null";
		}
	}
	
	public void setFileType(FileType fileType) {
		this.fileType = fileType;
	}
	public PaperType getPaperType() {
		return paperType;
	}
	public void setPaperType(PaperType paperType) {
		this.paperType = paperType;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public String getFileKey() {
		return fileKey;
	}
	public void setFileKey(String fileKey) {
		this.fileKey = fileKey;
	}

	public FinishedCall getFinshedCall() {
		return finshedCall;
	}

	public void setFinshedCall(FinishedCall finshedCall) {
		this.finshedCall = finshedCall;
	}

	public ResolveResult getResolveResult() {
		return resolveResult;
	}

	public void setResolveResult(ResolveResult resolveResult) {
		this.resolveResult = resolveResult;
	}

	public int getExamId() {
		return examId;
	}

	public void setExamId(int examId) {
		this.examId = examId;
	}

	@Override
	public String toString() {
		return "ResolveTask [id=" + id + ", index=" + index + ", examId=" + examId + ", fileType=" + fileType
				+ ", paperType=" + paperType + ", userId=" + userId + ", fileKey=" + fileKey + ", finshedCall="
				+ finshedCall + ", resolveResult=" + resolveResult + "]";
	}
}
